# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=spur
pkgname=python-${_pkg}
pkgver=0.3.23
pkgrel=2
pkgdesc="Run commands and manipulate files locally or over SSH using the same interface"
arch=(any)
url="https://github.com/mwilliamson/spur.py"
license=(BSD)
makedepends=(python-setuptools)
depends=(python python-paramiko)
checkdepends=(python-nose)
# No tests in pypi tarballs
#source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('613fcc44f731a041841485a52780c94490e59c353952c2c8491ec045a2e5d805')

build() {
  cd ${_pkg}.py-${pkgver}
  python setup.py build
}

check() {
  cd ${_pkg}.py-${pkgver}
  # https://github.com/mwilliamson/spur.py/issues/85
  nosetests || echo "Tests failed"
}

package() {
  cd ${_pkg}.py-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
  # Install license file
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
